﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
using System.Net.Http;

namespace KoolearnSample.Test
{
    [TestClass]
    public class UnitTest
    {
        [TestMethod]
        public async void TestMethodInternet()
        {
            try
            {
                var client = new HttpClient();
                var response = await client.GetAsync("http://app.koolearn.com/api/open/category.json");
                var content = await response.Content.ReadAsStringAsync();
                if (string.IsNullOrEmpty(content))
                    throw new Exception("result is empty,throw exception");
            }
            catch (Exception)
            {
                throw;
            }
        }
    }
}
